/**
 * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springblade.pm.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.core.secure.BladeUser;
import org.springblade.pm.entity.XmglProject;
import org.springblade.pm.entity.ZTProduct;
import org.springblade.pm.entity.ZTProject;
import org.springblade.pm.entity.ZTProjectproduct;
import org.springblade.pm.vo.PageQuery;
import org.springblade.pm.vo.XmglProjectVo;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 服务类
 *
 * @author Chill
 */
public interface IXmglProjectService extends IService<XmglProject> {
	List<Map<String, Object>> getLeader();

	List<XmglProject> getList(String gsid);

	/**
	 * 获取项目管理列表
	 *
	 * @param xmglProject
	 * @param pageQuery
	 * @return
	 */
	IPage<XmglProjectVo> getXmglList(XmglProject xmglProject, PageQuery pageQuery);

	/**
	 * 获取下拉列表
	 *
	 * @param type
	 * @return
	 */
	List<HashMap<String, Object>> getSelect(String type, String param);

	/**
	 * 根据用户角色和部门获取项目里列表
	 *
	 * @param bladeUser
	 * @return
	 */
	List<HashMap<String, Object>> getProjectListByRoleAndDept(BladeUser bladeUser);

	/**
	 * 根据项目编号获取项目id
	 */
	List<XmglProject> getXmlgIdByCode(String code);

	/**
	 * 根据项目类型获取项目编号
	 *
	 * @param projectCategory
	 */
	String getProjectCodeByProjectCategory(Integer projectCategory);

	/**
	 * 插入禅道项目表数据
	 *
	 * @param ztProject
	 * @return
	 */
	Boolean saveZT(ZTProject ztProject);

	/**
	 * 修改禅道项目表数据
	 *
	 * @param ztProject
	 * @return
	 */
	Boolean updateZT(ZTProject ztProject);



	/**
	 * 批量删除禅道数据库项目表
	 *
	 * @param codeList
	 * @return
	 */
	Boolean deleteBatchCodes(List<String> codeList);

	/**
	 * 批量删除
	 *
	 * @param ids
	 * @return
	 */
	Boolean removeByIds(List<Integer> ids);

	/**
	 * 插入禅道数据库真正项目表
	 *
	 * @param ztProduct
	 * @return
	 */
	Boolean saveZTProduct(ZTProduct ztProduct);

	/**
	 * 修改禅道数据库真正项目表
	 *
	 * @param ztProduct
	 * @return
	 */
	Boolean updateZTProduct(ZTProduct ztProduct);

	/**
	 * 插入禅道数据库项目迭代中间表
	 *
	 * @param ztProjectproduct
	 * @return
	 */
	Boolean saveZTProjectproduct(ZTProjectproduct ztProjectproduct);

	/**
	 * 查询项目Bug的各级数量
	 * @param projectCode
	 * @return
	 */
	Map<String,Integer> getBugList(String projectCode);

}
